[BC-breaking] Align ssim with psnr, metric output is tensor#2794
[BC-breaking] Align ssim with psnr, metric output is tensor#2794vfdev-5 merged 1 commit intopytorch:masterfrom
Conversation
|
@crj1998 thanks a lot for the PR ! I wonder about the common output type: tensor or float
@ydcjeff do you remember if there was a reason to output float value for SSIM and tensor for PSNR ? cc @sadra-barikbin what do you think ? |
I think that since ignite is an extension of pytorch, it's best to return the |
|
@crj1998 I merged your PR however running GPU tests there are few related failures : https://app.circleci.com/pipelines/github/pytorch/ignite/2900/workflows/45b4d299-599c-47e7-b0f6-121b0e4b5988/jobs/8072/parallel-runs/0/steps/0-107 Can you please check and fix them ? |
Yeah, as i said before, I do noting about unit test, so the previous test examples which return float will be failed. I will update unit test in a new pr. |
Description:
For the current version, the output of psnr and ssim are differnt type, where the type of psnr.comute() is
torch.Tensorbut the ssim.compute() isfloatThis is because in the ssim.py, there used
.item()ignite/ignite/metrics/psnr.py
Lines 120 to 124 in cdf7b47
while
ignite/ignite/metrics/ssim.py
Lines 182 to 186 in cdf7b47
The two metrics PSNR and SSIM are always used together. So I think it's better for the same input to have the same type of output. This is intuitive.
Check list:
I dont modify any unit test.